package j.framework.qmd.core;

import j.framework.domain.BaseDomain;
import j.util.jdbc.simple.annotation.Column;
import j.util.jdbc.simple.annotation.Table;

/**
 * User: jason
 * Date: 2014/11/24 10:53
 */
@Table(name="sys_query_field_footers",pkColumns = "footerId",ukColumns = "fieldId,calcType")
public class QueryFieldFooter extends BaseDomain {

    @Column(name="field_footer_id",needDes = true)
    private String footerId;

    @Column(name="query_field_id",nullable = false,displayName = "Footer计算字段")
    private String fieldId;

    @Column(name="calc_type",nullable = false,displayName = "Footer计算方式")
    private String calcType;

    @Column(name="format_options")
    private String formatOptions;

    @Column(name="display_order")
    private int rowNumber = 1;

    public String getFooterId() {
        return footerId;
    }
    public void setFooterId(String footerId) {
        this.footerId = footerId;
    }

    public String getFieldId() {
        return fieldId;
    }
    public void setFieldId(String fieldId) {
        this.fieldId = fieldId;
    }

    public String getCalcType() {
        return calcType;
    }
    public void setCalcType(String calcType) {
        this.calcType = calcType;
    }

    public String getFormatOptions() {
        return formatOptions;
    }
    public void setFormatOptions(String formatOptions) {
        this.formatOptions = formatOptions;
    }

    public int getRowNumber() {
        return rowNumber;
    }
    public void setRowNumber(int rowNumber) {
        this.rowNumber = rowNumber;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        QueryFieldFooter that = (QueryFieldFooter) o;

        if (footerId != null ? !footerId.equals(that.footerId) : that.footerId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return footerId != null ? footerId.hashCode() : 0;
    }

    /**
     * 获取主键的值
     *
     * @return
     */
    @Override
    public String getId() {
        return footerId;
    }

    /**
     * 设置主键
     *
     * @param id
     * @return
     */
    @Override
    public void setId(String id) {
        this.footerId   = id;
    }
}
